
***************************************************************************************
* Replication code for: "Inclusive or Exclusive? Candidate selection methods do not affect descriptive representation"
* Michal Grahn & Sandra Håkansson (2025)

* INSTALL PACKAGES
* ssc install coefplot
* ssc install estout
* net install grc1leg2.pkg, from (http://digital.cgdev.org/doc/stata/MO/Misc/)
* ssc install matmap
* ssc install mat2txt
* ssc install conjoint
* ssc install asdoc

* LOAD DATA 
use "Grahn Hakansson WEP 2025.dta", clear

* Figure 1
reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_memb

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_sel

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.incumbent_dummy_profile i.exp_profile i.leader_dummy_profile i.performance_profile i.loyal_profile i.media_profile2 if steg==2, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg2

coefplot (steg1_memb, offset(0.3) label("Party members" "primary context") mcolor(red) ciopts(recast(rcap) lcolor(red)) msymbol(S) msize(small)) (steg1_sel, offset(0) label("Selectors" "primary context") mcolor(blue) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(blue))) (steg2, offset(-0.3) label("Selectors" "ballot creation context") mcolor(forest_green) msymbol(D) msize(small) ciopts(recast(rcap) lcolor(forest_green))), xline(0.5, lpattern(-) lcolor(black)) headings(0.woman_dummy_profile="{bf:Gender}" 0.foreign_dummy_profile="{bf:Immigrant background}" 1.age_group_profile="{bf:Age}" 0.university_dummy_profile="{bf:Education}" 0.private_dummy_profile="{bf:Employment sector}") ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) graphregion(color(white) margin(zero)) coeflabels(Native="No" Foreign="Yes") scale(0.6) aspect(1) xtitle("Marginal means") ytitle("") title("", color(black)) subtitle("", color(black)) legend(region(color(none)) row(1) keygap(1) pos(6))

* FIGURE 2 *
reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==0, cluster(id)
margins i.member_profile i.exp_profile i.ideology_profile, post
estimates store fig2_memb

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==1, cluster(id)
margins i.member_profile i.exp_profile i.ideology_profile, post
estimates store fig2_sel

coefplot (fig2_memb, offset(0.15) label("Party members" "primary context") mcolor(red) ciopts(recast(rcap) lcolor(red)) msymbol(S) msize(small)) (fig2_sel, offset(-0.15) label("Selectors" "primary context") mcolor(blue) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(blue))), xline(0.5, lpattern(-) lcolor(black)) headings(1.member_profile="{bf:Time as party member}" 1.exp_profile="{bf:Political experience}" 1.ideology_profile="{bf:Ideology}") ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) graphregion(color(white) margin(zero)) coeflabels() scale(0.7) aspect(1) xtitle("Marginal effect") ytitle("") title("", color(black)) subtitle("", color(black)) legend(region(color(none)) row(1) colgap(8) keygap(1) pos(6))


* FIGURE C1 *
* Left and right respondents
reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==0 & resp_left_dummy==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_memb_right

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==1 & resp_left_dummy==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_sel_right

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.incumbent_dummy_profile i.exp_profile i.leader_dummy_profile i.performance_profile i.loyal_profile i.media_profile if steg==2 & resp_left_dummy==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg2_right

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==0 & resp_left_dummy==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_memb_left

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==1 & resp_left_dummy==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_sel_left

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.incumbent_dummy_profile i.exp_profile i.leader_dummy_profile i.performance_profile i.loyal_profile i.media_profile if steg==2 & resp_left_dummy==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg2_left

coefplot (steg1_memb_left, offset(0.3) label("Party members" "primary context") mcolor(red) ciopts(recast(rcap) lcolor(red)) msymbol(S) msize(small)) (steg1_sel_left, offset(0) label("Selectors" "primary context") mcolor(blue) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(blue))) (steg2_left, offset(-0.3) label("Selectors" "ballot creation context") mcolor(forest_green) msymbol(D) msize(small) ciopts(recast(rcap) lcolor(forest_green))), bylabel(Left) || (steg1_memb_right, offset(0.3) label("") nokey mcolor(red) ciopts(recast(rcap) lcolor(red)) msymbol(S) msize(small)) (steg1_sel_right, offset(0) label("") nokey mcolor(blue) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(blue))) (steg2_right, offset(-0.3) label("") nokey mcolor(forest_green) msymbol(D) msize(small) ciopts(recast(rcap) lcolor(forest_green))), bylabel(Right), , xline(0.5, lpattern(-) lcolor(black)) ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) coeflabels() aspect(1.5) xtitle("Marginal effect",) ytitle("") title("", color(black)) headings(0.woman_dummy_profile="{bf:Gender}" 0.foreign_dummy_profile="{bf:Immigrant background}" 1.age_group_profile="{bf:Age}" 0.university_dummy_profile="{bf:Education}" 0.private_dummy_profile="{bf:Employment sector}") subtitle(, color(black) bcolor(white)) legend(region(color(none) margin(zero)) row(1) keygap(1) pos(6)) norecycle byopts(compact cols(2) graphregion(color(white) margin(zero)) scale(0.65))


*** Figure C2: Left and right respondents
reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if resp_left_dummy==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store memb_right

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if resp_left_dummy==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store memb_left

coefplot (memb_right, offset(0.15) label("Right") mcolor(black) ciopts(recast(rcap) lcolor(black)) msymbol(S) msize(small)) (memb_left, offset(-0.15) label("Left") mcolor(gray) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(gray))), xline(0.5, lpattern(-) lcolor(black)) headings(0.woman_dummy_profile="{bf:Gender}" 0.foreign_dummy_profile="{bf:Immigrant background}" 1.age_group_profile="{bf:Age}" 0.university_dummy_profile="{bf:Education}" 0.private_dummy_profile="{bf:Employment sector}") ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) graphregion(color(white) margin(zero)) coeflabels() scale(0.7) aspect(1) xtitle("Marginal effect") ytitle("") title("", color(black)) subtitle("", color(black)) legend(region(color(none)) row(1) colgap(8) keygap(1) pos(6))


* FIGURE C3 *
* Women and men respondents
reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==0 & resp_male_dummy==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_memb_woman

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==1 & resp_male_dummy==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_sel_woman

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.incumbent_dummy_profile i.exp_profile i.leader_dummy_profile i.performance_profile i.loyal_profile i.media_profile if steg==2 & resp_male_dummy==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg2_woman

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==0 & resp_male_dummy==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_memb_man

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==1 & resp_male_dummy==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_sel_man

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.incumbent_dummy_profile i.exp_profile i.leader_dummy_profile i.performance_profile i.loyal_profile i.media_profile if steg==2 & resp_male_dummy==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg2_man

coefplot (steg1_memb_man, offset(0.3) label("Party members" "primary context") mcolor(red) ciopts(recast(rcap) lcolor(red)) msymbol(S) msize(small)) (steg1_sel_man, offset(0) label("Selectors" "primary context") mcolor(blue) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(blue))) (steg2_man, offset(-0.3) label("Selectors" "ballot creation context") mcolor(forest_green) msymbol(D) msize(small) ciopts(recast(rcap) lcolor(forest_green))), bylabel(Men) || (steg1_memb_woman, offset(0.3) label("") nokey mcolor(red) ciopts(recast(rcap) lcolor(red)) msymbol(S) msize(small)) (steg1_sel_woman, offset(0) label("") nokey mcolor(blue) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(blue))) (steg2_woman, offset(-0.3) label("") nokey mcolor(forest_green) msymbol(D) msize(small) ciopts(recast(rcap) lcolor(forest_green))), bylabel(Women), , xline(0.5, lpattern(-) lcolor(black)) ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) coeflabels() aspect(1.5) xtitle("Marginal effect",) ytitle("") title("", color(black)) headings(0.woman_dummy_profile="{bf:Gender}" 0.foreign_dummy_profile="{bf:Immigrant background}" 1.age_group_profile="{bf:Age}" 0.university_dummy_profile="{bf:Education}" 0.private_dummy_profile="{bf:Employment sector}") subtitle(, color(black) bcolor(white)) legend(region(color(none) margin(zero)) row(1) keygap(1) pos(6)) norecycle byopts(compact cols(2) graphregion(color(white) margin(zero)) scale(0.65))

*** Figure C4 Respondent gender, party actors compiled
reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if resp_male_dummy==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store memb_female

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if resp_male_dummy==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store memb_male

coefplot (memb_male, offset(0.15) label("Men") mcolor(black) ciopts(recast(rcap) lcolor(black)) msymbol(S) msize(small)) (memb_female, offset(-0.15) label("Women") mcolor(gray) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(gray))), xline(0.5, lpattern(-) lcolor(black)) headings(0.woman_dummy_profile="{bf:Gender}" 0.foreign_dummy_profile="{bf:Immigrant background}" 1.age_group_profile="{bf:Age}" 0.university_dummy_profile="{bf:Education}" 0.private_dummy_profile="{bf:Employment sector}") ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) graphregion(color(white) margin(zero)) coeflabels() scale(0.7) aspect(1) xtitle("Marginal effect") ytitle("") title("", color(black)) subtitle("", color(black)) legend(region(color(none)) row(1) colgap(8) keygap(1) pos(6))


* Figure C5: New and old party members
reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==0 & new_member==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_memb_old

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==0 & new_member==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_memb_new


coefplot (steg1_memb_new, offset(0.3) label("New party members" "primary context") mcolor(black) ciopts(recast(rcap) lcolor(black)) msymbol(S) msize(small)) (steg1_memb_old, offset(0) label("Old party members" "primary context") mcolor(black) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(black))), xline(0.5, lpattern(-) lcolor(black)) headings(0.woman_dummy_profile="{bf:Gender}" 0.foreign_dummy_profile="{bf:Immigrant background}" 1.age_group_profile="{bf:Age}" 0.university_dummy_profile="{bf:Education}" 0.private_dummy_profile="{bf:Employment sector}") ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) graphregion(color(white) margin(zero)) coeflabels(Native="No" Foreign="Yes") scale(0.6) aspect(1) xtitle("Marginal effect") ytitle("") title("", color(black)) subtitle("", color(black)) legend(region(color(none)) row(1) keygap(1) pos(6))


* Figure D1: AMCE of Figure 1
reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==0, cluster(id)
estimates store steg1_memb_AMCE

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==1, cluster(id)
estimates store steg1_sel_AMCE

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.incumbent_dummy_profile i.exp_profile i.leader_dummy_profile i.performance_profile i.loyal_profile i.media_profile if steg==2, cluster(id)
estimates store steg2_AMCE

coefplot (steg1_memb_AMCE, drop(_cons) keep(*.woman_dummy_profile *.foreign_dummy_profile *.age_group_profile *.university_dummy_profile *.private_dummy_profile) omitted baselevels offset(0.3) label("Party members" "primary context") mcolor(red) ciopts(recast(rcap) lcolor(red)) msymbol(S) msize(small)) (steg1_sel_AMCE, drop(_cons) keep(*.woman_dummy_profile *.foreign_dummy_profile *.age_group_profile *.university_dummy_profile *.private_dummy_profile) omitted baselevels offset(0) label("Selectors" "primary context") mcolor(blue) msymbol(O) ciopts(recast(rcap) lcolor(blue))) (steg2_AMCE, drop(_cons) keep(*.woman_dummy_profile *.foreign_dummy_profile *.age_group_profile *.university_dummy_profile *.private_dummy_profile) omitted baselevels offset(-0.3) label("Selectors" "ballot creation context") mcolor(forest_green) msymbol(D) msize(small) ciopts(recast(rcap) lcolor(forest_green))), xline(0, lpattern(-) lcolor(black)) headings(0.woman_dummy_profile="{bf:Gender}" 0.foreign_dummy_profile="{bf:Immigrant background}" 1.age_group_profile="{bf:Age}" 0.university_dummy_profile="{bf:Education}" 0.private_dummy_profile="{bf:Employment sector}") ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) graphregion(color(white) margin(zero)) coeflabels() scale(0.6) aspect(1) xtitle("AMCE") ytitle("") title("", color(black)) subtitle("", color(black)) legend(region(color(none)) row(1) keygap(1) pos(6))

* Figure D2: AMCE estimations of Figure 2
reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==0, cluster(id)
estimates store fig2_memb_AMCE

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==1, cluster(id)
estimates store fig2_sel_AMCE

coefplot (fig2_memb_AMCE, keep(*.member_profile *.exp_profile *.ideology_profile) omitted baselevels offset(0.15) label("Party members" "primary context") mcolor(red) ciopts(recast(rcap) lcolor(red)) msymbol(S) msize(small)) (fig2_sel_AMCE, keep(*.member_profile *.exp_profile *.ideology_profile) omitted baselevels offset(-0.15) label("Selectors" "primary context") mcolor(blue) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(blue))), xline(0, lpattern(-) lcolor(black)) headings(1.member_profile="{bf:Time as party member}" 1.exp_profile="{bf:Political experience}" 1.ideology_profile="{bf:Ideology}") ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) graphregion(color(white) margin(zero)) coeflabels() scale(0.7) aspect(1) xtitle("AMCE") ytitle("") title("", color(black)) subtitle("", color(black)) legend(region(color(none)) colgap(8) row(1) keygap(1) pos(6))

* Figure E1: Full model, primary context

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile, post
estimates store steg1_memb

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile if steg==1 & resp_selector_dummy==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile i.ideology_profile, post
estimates store steg1_sel

coefplot (steg1_memb, offset(0.3) label("Party members" "primary context") mcolor(red) ciopts(recast(rcap) lcolor(red)) msymbol(S) msize(small)) (steg1_sel, offset(0) label("Selectors" "primary context") mcolor(blue) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(blue))), xline(0.5, lpattern(-) lcolor(black)) headings(0.woman_dummy_profile="{bf:Gender}" 0.foreign_dummy_profile="{bf:Immigrant background}" 1.age_group_profile="{bf:Age}" 0.university_dummy_profile="{bf:Education}" 0.private_dummy_profile="{bf:Employment sector}" 1.member_profile="{bf:Party membership}" 1.exp_profile="{bf:Experience}" 1.ideology_profile="{bf:Ideological orientation within the party}") ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) graphregion(color(white) margin(zero)) coeflabels(Native="No" Foreign="Yes") scale(0.6) aspect(1) xtitle("Marginal effect") ytitle("") title("", color(black)) subtitle("", color(black)) legend(region(color(none)) row(1) keygap(1) pos(6))

***** Full model, ballot context
reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.incumbent_dummy_profile i.exp_profile i.leader_dummy_profile i.performance_profile i.loyal_profile i.media2_profile if steg==2, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.incumbent_dummy_profile i.exp_profile i.leader_dummy_profile i.performance_profile i.loyal_profile i.media2_profile, post
estimates store steg2

coefplot (steg2, offset(-0.3) label("Selectors" "ballot creation context") mcolor(forest_green) msymbol(D) msize(small) ciopts(recast(rcap) lcolor(forest_green))), xline(0.5, lpattern(-) lcolor(black)) headings(0.woman_dummy_profile="{bf:Gender}" 0.foreign_dummy_profile="{bf:Immigrant background}" 1.age_group_profile="{bf:Age}" 0.university_dummy_profile="{bf:Education}" 0.private_dummy_profile="{bf:Employment sector}" 0.incumbent_dummy_profile="{bf:Inbumbent}" 1.exp_profile="{bf:Political experience}" 0.leader_dummy_profile="{bf:Leadership experience}" 1.performance_profile="{bf:Track record}" 1.loyal_profile="{bf:Loyalty}" 0.media2_profile="{bf:Active in media}") ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) graphregion(color(white) margin(zero)) coeflabels(Native="No" Foreign="Yes") scale(0.6) aspect(1) xtitle("Marginal effect") ytitle("") title("", color(black)) subtitle("", color(black)) legend(region(color(none)) row(1) keygap(1) pos(6))

* Figure E5: Ideology and candidates' identity characteristics
reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile if steg==1 & resp_selector_dummy==0 & mainstream==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_memb_mainstream

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile if steg==1 & resp_selector_dummy==1 & mainstream==1, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_sel_mainstream

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile if steg==1 & resp_selector_dummy==0 & mainstream==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_memb_nonmainstream

reg chosen i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile i.member_profile i.exp_profile if steg==1 & resp_selector_dummy==1 & mainstream==0, cluster(id)
margins i.woman_dummy_profile i.foreign_dummy_profile i.age_group_profile i.university_dummy_profile i.private_dummy_profile, post
estimates store steg1_sel_nonmainstream

coefplot (steg1_memb_mainstream, offset(0.3) label("Party members" "Mainstream" "ideology candidates") mcolor(red) ciopts(recast(rcap) lcolor(red)) msymbol(S) msize(small)) (steg1_sel_mainstream, offset(0) label("Selectors" "Mainstream" "ideology candidates") mcolor(blue) msymbol(O) msize(small) ciopts(recast(rcap) lcolor(blue))) (steg1_memb_nonmainstream, offset(-0.3) label("Party members" "Non-mainstream" "ideology candidates") mcolor(red) msymbol(Sh) msize(small) ciopts(recast(rcap) lcolor(red))) (steg1_sel_nonmainstream, offset(0) label("Selectors" "Non-mainstream" "ideology candidates") mcolor(blue) msymbol(Oh) msize(small) ciopts(recast(rcap) lcolor(blue))), xline(0.5, lpattern(-) lcolor(black)) headings(0.woman_dummy_profile="{bf:Gender}" 0.foreign_dummy_profile="{bf:Immigrant background}" 1.age_group_profile="{bf:Age}" 0.university_dummy_profile="{bf:Education}" 0.private_dummy_profile="{bf:Employment sector}") ylab(, glcolor(gs9) glpattern(.)) xlabel(, grid glcolor(gs9) glpattern(.)) graphregion(color(white) margin(zero)) coeflabels(Native="No" Foreign="Yes") scale(0.6) aspect(1) xtitle("Marginal effect") ytitle("") title("", color(black)) subtitle("", color(black)) legend(region(color(none)) row(1) keygap(1) pos(6))


